package com.wontube.smr.web.controller.video;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * post the video to our site
 * 
 * @author hewc@wondershare.cn
 * 
 */
@Controller
public class PostVideoController {

	@RequestMapping("/video/bookmarklet/loading")
	public ModelAndView postIndex(@RequestParam(value = "bver", required = false) String bver,
			@RequestParam(value = "lver", required = false) String lver,
			@RequestParam(value = "loc", required = false) String loc,
			@RequestParam(value = "emb", required = false) String emb) {
		ModelAndView mv = new ModelAndView("video/post/post_index");
		//int beginIndex = loc.indexOf("v=") + 2;
		//int endIndex = loc.indexOf("&feature");
		//String movieId = "yt" + loc.substring(beginIndex, endIndex);
		// String movieId="4utw3HG7M-U";
		//Remoting<IMovieHandler> remoting = new Remoting<IMovieHandler>();
		//IMovieHandler handler = remoting.createService(IMovieHandler.class);
		//Movie show = handler.getMovie(movieId);
		//mv.addObject("showItems", show);
		mv.addObject("loc",loc);
		return mv;
	}

}
